/*
 * RSName.cpp
 *
 *  Created on: 2010/03/17
 *      Author: alexandre
 */

#include "RSName.h"

namespace Realsphere {

    RSName::RSName ( ) :
        RSValueElement ()
    {
    }

    RSName::RSName ( const QString& rScopeId ) :
        RSValueElement ( rScopeId )
    {
    }

    RSName::RSName ( QString& rValue ) :
        RSValueElement ()
    {
        SetValue ( rValue, false );
    }

    RSName::RSName ( const QString& rScopeId, QString& rValue ) :
            RSValueElement ( rScopeId )
    {
        SetValue ( rValue, false );
    }

    RSValueType RSName::ValueType () const
    {
        return RS_NAME;
    }

    RSDataSize RSName::SizeOf () const
    {
        return mValue.size();
    }


    RSDataPointer RSName::DataPointer()
    {
        return &mValue;
    }


    QString RSName::ToString () const
    {
        return mValue;
    }

    QString RSName::Value () const
    {
        return mValue;
    }

    void RSName::SetValue ( const char* rValue, bool rEmit )
    {
        mValue = rValue;
        if ( rEmit )
            emit ValueChanged();
    }

    void RSName::SetValue ( const QString& rValue, bool rEmit )
    {
        mValue = rValue;
        if ( rEmit )
            emit ValueChanged();
    }

    void RSName::SetValue ( const RSName& rValue, bool rEmit )
    {
        SetValue ( rValue.Value(), rEmit );
    }

    RSName& RSName::operator=( const char* rValue )
    {
        SetValue( rValue );
        return *this;
    }

    RSName& RSName::operator=( const QString& rValue )
    {
        SetValue( rValue );
        return *this;
    }

    RSName& RSName::operator=( const RSName& rValue )
    {
        SetValue( rValue );
        return *this;
    }

}
